//
//  NewQianBaoViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/25.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewQianBaoViewController.h"
#import "JTCSM.h"
#import "MyDoubleLabelView.h"
#import "MyInfoView.h"
#import "PayBankCarListViewController.h"
#import "NewChongZhiViewController.h"
#import "NewTiXianViewController.h"
#import "NewQianbaoJiLuViewController.h"
#import "NewKaQuanViewController.h"
static CGFloat space = 20;
static CGFloat myinfoHeight = 50;
@interface NewQianBaoViewController ()
@property (nonatomic,strong) MyDoubleLabelView *doubleView;
@end

@implementation NewQianBaoViewController

- (void)gotBack{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [df isRemoveTarbar:YES];
    self.navigationController.navigationBar.hidden = NO;
    self.view.backgroundColor =RGBACOLOR(251, 251, 251, 1);
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotBack)];
    [self layoutSubViews];
}

- (void)layoutSubViews{
    CGFloat headerIamgeVWidth = KCONTROLLERWith;
    CGFloat headerIamgeVHeight = headerIamgeVWidth *0.426667;
    UIImageView *headerIamgeV = [[UIImageView alloc]initWithFrame:CGRectMake(0, KagainChangeHeight, headerIamgeVWidth, headerIamgeVHeight)];
    headerIamgeV.image = [UIImage imageNamed:@"钱包_背景.png"];
    [self.view addSubview:headerIamgeV];
    
    self.doubleView = [[MyDoubleLabelView alloc]initWithFrame:CGRectMake(space, 0, KCONTROLLERWith-2*space, headerIamgeVHeight) leftTitleFontsize:16 titlecolor:[UIColor whiteColor] contentFontsize:40 contentcolor:[UIColor whiteColor]];
    [headerIamgeV addSubview:self.doubleView];
    [self.doubleView InsertSpacesetvalueWithModel:@{KDoubleLabelTitle:@"钱包余额（元）",KDoubleLabelContent:@"1398353.00"} changeLabelY:19];
    
    NSArray *array = @[@"充值",@"提现"];
    NSArray *iamgearray = @[@"钱包_充值.png",@"钱包_提现.png"];
    NSArray *array1 = @[@"银行卡",@"卡券"];
    NSArray *imagearray1 = @[@"钱包_银行卡.png",@"钱包_卡券.png"];
    NSArray *array2 = @[@"钱包记录"];
    NSArray *imagearray2 = @[@"钱包_记录.png"];
    for (int i = 0; i < array.count; i++) {
        MyInfoView *view1 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerIamgeV)+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:iamgearray[i] title:array[i]placeholder:nil isShowLabel:ImageViewType radioBtnIndex:0 GroupId:@""];
        view1.tag = 100+i;
        view1.userInteractionEnabled = YES;
        [df addTapGestureRecognizerWithTarget:self action:@selector(gotoVC:) andaddView:view1];
        [self.view addSubview:view1];
    }
    [df lineViewWithHeightofTop:KVIEW_Y(headerIamgeV)+myinfoHeight*array.count+10 superView:self.view spacing:0 color:RGBACOLOR(241, 241, 241, 1) lineHeight:10];
    for (int i = 0; i < array1.count; i++) {
        MyInfoView *view2 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerIamgeV)+myinfoHeight*array.count+10+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:imagearray1[i] title:array1[i]placeholder:nil isShowLabel:ImageViewType radioBtnIndex:0 GroupId:@""];
        view2.tag = 200+i;
        view2.userInteractionEnabled = YES;
        [df addTapGestureRecognizerWithTarget:self action:@selector(gotoVC:) andaddView:view2];
        [self.view addSubview:view2];
    }
    [df lineViewWithHeightofTop:KVIEW_Y(headerIamgeV)+myinfoHeight*(array.count+array1.count)+20 superView:self.view spacing:0 color:RGBACOLOR(241, 241, 241, 1) lineHeight:10];
    for (int i = 0; i < array2.count; i++) {
        MyInfoView *view3 = [[MyInfoView alloc]initWithFrame:CGRectMake(0, KVIEW_Y(headerIamgeV)+myinfoHeight*(array.count+array1.count)+20+myinfoHeight*i, KCONTROLLERWith, myinfoHeight) imagename:imagearray2[i] title:array2[i]placeholder:nil isShowLabel:ImageViewType radioBtnIndex:0 GroupId:@""];
        view3.tag = 300+i;
        view3.userInteractionEnabled = YES;
        [df addTapGestureRecognizerWithTarget:self action:@selector(gotoVC:) andaddView:view3];
        [self.view addSubview:view3];
        
    }
}
- (void)gotoVC:(UITapGestureRecognizer *)tap{
    switch ([tap view].tag) {
        case 100:
            [self gotoNewChongZhiViewController];
            break;
        case 101:
            [self gotoNewTiXianViewController];
            break;
        case 200:
            [self gotobankList];
            break;
        case 201:
            [self gotoKaQuanVC];
            break;
        case 300:
            [self gotoQianBaoJiLuVC];
            break;
        default:
            break;
    }
}

- (void)gotoQianBaoJiLuVC{
    NewQianbaoJiLuViewController *vc = [[NewQianbaoJiLuViewController alloc]init];
    vc.nameTitle = @"钱包记录";
    [self.navigationController pushViewController:vc animated:YES];
    
}
- (void)gotoKaQuanVC{
    NewKaQuanViewController *vc = [[NewKaQuanViewController alloc]init];
    vc.nameTitle = @"卡券";
    [self.navigationController pushViewController:vc animated:YES];
    
}

- (void)gotobankList{
    PayBankCarListViewController *vc = [[PayBankCarListViewController alloc]init];
    vc.nameTitle = @"银行卡";
    vc.isbanklist = YES;
    [self.navigationController pushViewController:vc animated:YES];
    
}
- (void)gotoNewTiXianViewController{
    NewTiXianViewController *vc = [[NewTiXianViewController alloc]init];
    vc.nameTitle = @"提现";
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)gotoNewChongZhiViewController{
    NewChongZhiViewController *vc = [[NewChongZhiViewController alloc]init];
    vc.nameTitle = @"充值";
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
